package com.zhanghp.utils;

import static java.lang.Math.random;

/**
 * @author zhanghp
 * @date 2023-07-30 15:14
 */
public class CommonUtils {
    public static final int TEST_COUNT = 1_000_000;

    /**
     * 水平分界线打印
     */
    public static void printDivingLine() {
        System.out.printf("%n%s%n", "===============Diving Line==================");
    }

    /**
     * 对数器-数组生成
     *
     * @param maxLength 长度最大限制
     * @param maxValue  数值最大限制
     * @return 随机数组
     */
    public static int[] rand(int maxLength, int maxValue) {
        int length = (int) (random() * maxLength);
        int[] arr = new int[length];
        for (int i = 0; i < length; i++) {
            arr[i] = ((int) (random() * maxValue));
        }
        return arr;
    }
}
